package cn.com.dhcc.ddi.datamapping.vo.wapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import cn.com.dhcc.app.core.handler.dbhandler.WappedResultSet;
import cn.com.dhcc.app.core.util.StrUtil;
import cn.com.dhcc.ddi.datamapping.vo.FuncMapping;

/**
 * @日期：2016/12/22 14:56
 * @作者：张洪涛
 * @版权所有：东华软件
 * @版本：1.0
 */
public class FuncMappingRowWapper implements RowMapper<FuncMapping> {
    @Override
    public FuncMapping mapRow(ResultSet rss, int rowNum) throws SQLException {
        WappedResultSet rs = new WappedResultSet(rss);
        FuncMapping vo = new FuncMapping();
        vo.setId(rs.getString("id"));
        vo.setMappingId(rs.getString("mapping_id"));
        vo.setTableName(rs.getString("table_name"));
        vo.setActObj(rs.getString("act_obj"));
        vo.setFxId(rs.getString("fx_id"));
        vo.setArgContent(rs.getString("arg_content"));
        vo.setFxActOnType(rs.getString("fx_act_on_type"));
        if(StrUtil.isNotBank(rs.getString("fx_exec_order"))){
            vo.setFxExecOrder(Integer.parseInt(rs.getString("fx_exec_order")));
        }
        vo.setMtime(rs.getDate("mtime"));

        vo.setFxNameEn(rs.getString("fx_name_en"));
        return vo;

    }
}
